package com.jarvan.repository;

import com.jarvan.model.Trains;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface TrainsRepository extends JpaRepository<Trains, String> {
    List<Trains> findByStartAndEnd(String start, String end);
    List<Trains> findAllByStationsContainingAndStationsContaining(String station1, String station2);
    Page<Trains> findAllByTrainStatus(Integer status, Pageable pageable);
}
